<?php

class Viewer extends Controller {

    function __construct() {
        parent::__construct();

        if (!UserAccess::checkLoggedin()) { //If user is not logged in sent back to login page
            header('location: ' . URL . 'login');
            exit;
        }

//       $this->view->js_desktop[0] = 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js';
//       $this->view->js_desktop[1] = 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js';       
        $this->view->js_desktop[0] = URL . 'public/js/jquery_min.js';
        $this->view->js_desktop[1] = URL . 'public/js/jquery_ui_min.js';
        $this->view->js_desktop[2] = URL . 'public/js/tabs.js';
        $this->view->js_desktop[3] = URL . 'public/js/sendmessage.js';
        $this->view->js_desktop[4] = URL . 'public/js/picklist.js';
        $this->view->js_desktop[5] = URL . 'public/js/slide.js';
        $this->view->js_desktop[6] = URL . 'public/js/equalheights.js';

        $this->view->css_desktop[0] = URL . 'public/css/default.css';
        $this->view->css_desktop[1] = URL . 'public/css/picklist.css';
        $this->view->css_desktop[2] = URL . 'public/css/slide.css';
    }

    function index() {
        if (UserAccess::GetMobileViewer())
            $this->view->render('mobile/login/index');
        else
            $this->view->render('desktop/viewer/index');
    }

    function getmemberview($memberIdViewer) {
        $_SESSION["memberIdViewer"] = $memberIdViewer;
        header('location: '.URL.'viewer');
    }

}
